/**
 * Research topics list
 * 
 * Every research topic have to got a relation with year
 * 
 * 
 */

const Sequelize = require('sequelize');
const MySQLManager = require('../utils/MySQLManager');


const Company = MySQLManager.define('company', {

    // 公司名称
	company_name: {
        type: Sequelize.STRING,
		allowNull: false
    },

    // 所属年度
    company_year: {
        type: Sequelize.STRING,
        allowNull: false,
        unique: 'name',
    },

    // 公司网站
    company_website: {
        type: Sequelize.STRING,
    },

    // 公司联系号码
    company_phone: {
        type: Sequelize.STRING,
    },

    // 公司邮箱
    company_email: {
        type: Sequelize.STRING,
    },

    // 公司联系人
    company_contacts: {
        type: Sequelize.STRING,
    },

    // 公司地址
    company_address: {
        type: Sequelize.STRING,
    },

    // 岗位名称
    job_name: {
        type: Sequelize.STRING,
        // allowNull: false
    },

    // 岗位职责 
    job_duty: {
        type: Sequelize.STRING,
    },

    // 需要人数
    student_limit: {
        type: Sequelize.INTEGER,
        defaultValue: 0
    },

    // 当前报名人数
    current_student: {
        type: Sequelize.INTEGER,
        defaultValue: 0
    },

    // 技能要求
    requisite_skills: {
        type: Sequelize.STRING(1024)
    },

    // 待遇
    salary: {
        type: Sequelize.STRING(1024),
    },

    // 其他备注
    remark: {
        type: Sequelize.STRING(1024),
    },

    // 推荐老师
    recommend_teacher: {
        type: Sequelize.STRING
    },

    // 工作时间
    working_time: {
        type: Sequelize.STRING
    },

    // 类型 1 校外岗位， 0 校内岗位, 2学生自报岗位
    type: {
        type: Sequelize.STRING,
        defaultValue: '1'
    },

    create_student: {
        type: Sequelize.STRING,
        unique: 'name',
    }

    // //   备用字段
	//   beiyong1: {
	// 	type: Sequelize.STRING
	//   },
	//   beiyong2: {
	// 	type: Sequelize.STRING
	//   },
	//   beiyong3: {
	// 	type: Sequelize.STRING
    //   },
    //   beiyong4: {
	// 	type: Sequelize.STRING
    //   },
    //   beiyong5: {
	// 	type: Sequelize.STRING
    //   },
    //   beiyong6: {
	// 	type: Sequelize.STRING
    //   },
    //   beiyong7: {
	// 	type: Sequelize.STRING
    //   },
    //   beiyong8: {
	// 	type: Sequelize.STRING
    //   },
    //   beiyong9: {
	// 	type: Sequelize.STRING
    //   },
    //   beiyong10: {
	// 	type: Sequelize.STRING
	//   }
});


module.exports = Company

